Device Certificate
The /files/tls/<id>/certificate URL provides access to the device certificate of the specific TLS context. You may download the current certificate or upload a new one. When uploading (via PUT method), the certificate must be specified in PEM format.
URL
/api/v1/files/tls/<id>/certificate
HTTP Methods
GET, PUT
HTTP Responses
|
■
|
400 Bad request – provided certificate file is wrong (e.g. not in PEM format) |
|
■
|
409 Conflict – certificate can’t be loaded due to current device state (e.g. redundant board is synchronizing). |
Example 1
GET /api/v1/files/tls/2/certificate HTTP/1.1
Host: 10.4.219.229
HTTP/1.1 200 OK
Content-Type: application/octet-stream
-----BEGIN CERTIFICATE-----
MIIDMjCCAhqgAwIBAgIBBDANBgkqhkiG9w0BAQUFADAfMQwwCgYDVQQKEwNBQ0wx
DzANBgNVBAMTBlJvb3RDQTAeFw0wMDAxMDEwMDAwMDBaFw0zMDAxMDEwMDAwMDBa
...
EcqvMKSuAmR8Csl5STrVo+7m4IgEYCTrRZ1hVL/wB8PSD51sg4lGyhos97Q7kH0w
T9cKHStw
-----END CERTIFICATE-----
Example 2
PUT /api/v1/files/tls/2/certificate HTTP/1.1
Host: 10.4.219.229
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="cert.pem"
Content-Type: application/octet-stream
-----BEGIN CERTIFICATE-----
MIIDMjCCAhqgAwIBAgIBBDANBgkqhkiG9w0BAQUFADAfMQwwCgYDVQQKEwNBQ0wx
DzANBgNVBAMTBlJvb3RDQTAeFw0wMDAxMDEwMDAwMDBaFw0zMDAxMDEwMDAwMDBa
...
EcqvMKSuAmR8Csl5STrVo+7m4IgEYCTrRZ1hVL/wB8PSD51sg4lGyhos97Q7kH0w
T9cKHStw
------WebKitFormBoundary7MA4YWxkTrZu0gW--
HTTP/1.1 200 OK
Content-Type: application/json
{
"description": "Certificate was successfully changed"
}